package ru.reaperoq.taskmanager.repositories

import org.springframework.data.repository.CrudRepository
import ru.reaperoq.taskmanager.models.Tag
import ru.reaperoq.taskmanager.models.Task
import java.util.UUID

interface TaskRepository : CrudRepository<Task, Long> {
    fun findTasksByTitleOrderByTitle(title: String): List<Task>

    fun findTasksByTagsOrderByCreatedAtDesc(tags: Set<Tag>): List<Task>

    fun getTasksByListId(id: Long): List<Task>

    fun findTaskBySharedId(uuid: UUID): Task?

    fun getTasksByAuthorIdAndParentIsNull(userId: Long): List<Task>

    fun findTaskById(id: Long): Task?
}